<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="org.lanqiao.dxzf.entity.ResultBill"%>
	<%@page import="org.lanqiao.dxzf.entity.Page"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <link type="text/css" rel="stylesheet" media="all" href="${pageContext.request.contextPath}/css/global.css" />
        <link type="text/css" rel="stylesheet" media="all" href="${pageContext.request.contextPath}/css/global_color.css" /> 
        <script type="text/javascript">
        function goPage(page){
        	location.href="bill_Service.do?currentPage="+page;
        	}
			$(function() {
				$(".bill_off").attr("class", "bill_on");
			})
			function sub(pageIndex) {
				var tatolPages = ${page.allPage};
				$("#pageIndex").attr("value",pageIndex);
				if (pageIndex >= 1 && tatolPages >= pageIndex) {
					location.href = "${pageContext.request.contextPath}/bill/detail.action?pageIndex="+pageIndex+"&ite_id="+${item.ite_id};
				}
			}
		</script>
    </head>
    <body onload="initialYearAndMonth();">
        <!--Logo区域开始-->
        <%@include file="../include/header.jsp"%>
        <!--导航区域结束-->
        <!--主要区域开始-->
        <div id="main">
		<form action="" method="">
			<!--查询-->
			<div class="search_add">
				<div>
					账务账号：<span class="readonly width70">${service.account.acc_account }</span>
				</div>
				<div>
					OS 账号：<span class="readonly width70">${service.ser_os }</span>
				</div>
				<div>
					服务器 IP：<span class="readonly width100">${service.ser_ip }</span>
				</div>
				<div>
					计费时间：<span class="readonly width100"><fmt:formatDate
							value="${bill.bill_time }" pattern="yyyy年MM月" /></span>
				</div>
				<div>
					<!-- 费用：<span class="readonly width50"></span> -->
				</div>
				<input type="button" value="返回" class="70width; btn_add"
					onclick="location.href ='${pageContext.request.contextPath}/?bill_id=${detail.dataList.bid}';" />
			</div>
                <!--数据区域：用表格展示数据-->     
                <div id="data">            
                    <table id="datalist">
                        <tr>
                            <th class="width150">客户登录 IP</th>
                            <th class="width150">登入时刻</th>
                            <th class="width150">登出时刻</th>
                            <th class="width100">时长（秒）</th>
                            <th class="width150">费用</th>
                            <th>资费</th>
                        </tr>
                        <c:forEach items="${detail.dataList}" var="detail">
						<tr>
	                    	<td>${detail.server_ip}</td>
	                    	<td>${detail.log_time}</td>
	                    	<td>${detail.exit_time}</td>
	                    	<td>${detail.duration}</td>
	                    	<td>${detail.c_price}</td>
	                    	<td>${detail.fname}</td>
						</tr>
					</c:forEach>
                    </table>
                </div>
                <!--分页-->
                <div id="pages">
				<div style="text-align:center; margin-top:40px" id="venderfen">
				        当前第${paging.currentPage }页/共${paging.totalPage }页
				        <c:choose>
				            <c:when test="${paging.currentPage==1&&paging.totalPage==0}">
				
				            </c:when>
				            <c:when test="${paging.currentPage==1&&paging.totalPage==1}">
				
				            </c:when>
				            <c:when test="${paging.currentPage==2&&paging.totalPage==2}">
				                <input type="button" value="首页" onclick="goPage(1)" />
				                <input type="button" value="上一页"
				                    onclick="goPage(${paging.currentPage-1})" />
				            </c:when>
				            <c:when test="${paging.currentPage==1 }">
				            <input type="button" value="上一页" >
				                <input type="button" value="下一页"
				                    onclick="goPage(${paging.currentPage+1})" />
				                <input type="button" value="末页"
				                    onclick="goPage(${paging.totalPage})" />
				            </c:when>
				            <c:when test="${paging.currentPage==paging.totalPage }">
				                <input type="button" value="首页" onclick="goPage(1)" />
				                <input type="button" value="上一页"
				                    onclick="goPage(${paging.currentPage-1})" />
				            </c:when>
				            <c:otherwise>
				                <input type="button" value="首页" onclick="goPage(1)" />
				                <input type="button" value="上一页"
				                    onclick="goPage(${paging.currentPage-1})" />
				                <input type="button" value="下一页"
				                    onclick="goPage(${paging.currentPage+1})" />
				                <input type="button" value="末页"
				                    onclick="goPage(${paging.totalPage})" />
				            </c:otherwise>
				        </c:choose>
			</div>
		</form>
	</div>
        <!--主要区域结束-->
        <div id="footer">
           
        </div>
        <script type="text/javascript" language="javascript">
        //根据权限显示信息
        var listPrivs = "${sessionScope.listPrivs}";
        for(var p of listPrivs){
        if(p=="1")  {document.getElementById("p1").style.display="block";}
        if(p=="2")  {document.getElementById("p2").style.display="block";}
        if(p=="3")	{document.getElementById("p3").style.display="block";}
        if(p=="4")	{document.getElementById("p4").style.display="block";}
        if(p=="5")	{document.getElementById("p5").style.display="block";}
        if(p=="6")	{document.getElementById("p6").style.display="block";}
        if(p=="7")	{document.getElementById("p7").style.display="block";}
        }
        </script>
    </body>
</html>
